var netTool
var apiPath = 'capi/V2/account/memberUserAccountRecord/'
var mDate = require("../tools/date")

function OilRecord(_netTool) {
	netTool = _netTool
	
	this.list = function(data, fn) {
		netTool.getAjaxUrlValueBackground(apiPath + 'crudPage', {
			rows: 1000,
			user_id: uni.getStorageSync('user_id'),
		}, function(res) {
			typeof fn == 'function' && fn(res);
		})
	}

	this.update = function(data, fn) {
		netTool.getAjaxUrlValueBackground(apiPath + 'update', {
			user_id: uni.getStorageSync('user_id'),
			...data,
		}, function(res) {
			typeof fn == 'function' && fn(res);
		})
	}
	this.fresh = function(data, fn) {
		// page.currentPage=1
		this.findOrder(data, fn)
	}
	this.getMore = function(data, fn) {
		var data = {
			page: data.page + 1,
			total: data.total
		};
		var page = {
			page: data.page,
			status: data.status,
			rows: 3,
		}
		if (data.total >= data.page) {
			this.findOrder(page, fn)
		} else {
			console.log("没有了")
		}
	}
	// 油价查询
	this.queryOil = function(data, fn) {
		netTool.getAjaxUrlValueBackground('capi/V2/FFPrice/ffAreaPrice/list', {

		}, function(res) {
			typeof fn == 'function' && fn(res);
		});
	}

}
module.exports = OilRecord;
